package com.midian.service.advertisePic.impl;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.midian.common.dao.BaseDaoTemplet;
import com.midian.common.dao.OrderHelper;
import com.midian.common.dao.SearchHelper;
import com.midian.common.dao.SearchHelper.Type;
import com.midian.common.exception.BizException;
import com.midian.common.pager.Pager;
import com.midian.model.advertisePic.AdvertisePic;
import com.midian.service.advertisePic.IAdvertisePicService;
import com.midian.service.common.BaseService;

@Service(value = "advertisePicService")
public class AdvertisePicServiceImpl extends BaseService implements IAdvertisePicService{

	private BaseDaoTemplet<AdvertisePic> advertisePicDAO;
	
	@Resource(name = "advertisePicDAO")
	public void setAdvertisePicDAO(BaseDaoTemplet<AdvertisePic> advertisePicDAO) {
		this.advertisePicDAO = advertisePicDAO;
	}

	@Override
	public AdvertisePic add(AdvertisePic target) throws BizException {
		this.advertisePicDAO.add(target);
		return target;
	}

	@Override
	public void update(AdvertisePic target) throws BizException {
		this.advertisePicDAO.updateByConvertHql(target);
		
	}

	@Override
	public void delete(Serializable id) throws BizException {
		this.advertisePicDAO.delete(id);
		
	}

	@Override
	public void delete(Serializable[] ids) throws BizException {
		this.advertisePicDAO.delete(ids);
		
	}

	@Override
	public AdvertisePic get(Serializable id) throws BizException {
		return this.advertisePicDAO.get(id);
	}

	@Override
	public List<AdvertisePic> showList(AdvertisePic target, Pager pager, List<OrderHelper> helper) throws BizException {
		return this.advertisePicDAO.find(target, getSearchHelper(), helper, pager);
	}

	@Override
	public void opDelFlag(Serializable[] ids, Integer status) throws BizException {
		this.advertisePicDAO.opDelFlag(ids, status);
		
	}

	@Override
	protected List<SearchHelper> getSearchHelper() {
		String[] attrs = {};
		Type[] types = {};
		return SearchHelper.getSearchList(attrs, types);
	}

}
